# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AlertCenter.V1beta1.Model.AccessApproval do
  @moduledoc """
  Alert that is triggered when Google support requests to access customer data.

  ## Attributes

  *   `justificationReason` (*type:* `list(String.t)`, *default:* `nil`) - Justification for data access based on justification enums.
  *   `officeLocation` (*type:* `String.t`, *default:* `nil`) - Office location of Google staff requesting access such as "US".
  *   `products` (*type:* `list(String.t)`, *default:* `nil`) - Products within scope of the Access Approvals request.
  *   `requestId` (*type:* `String.t`, *default:* `nil`) - ID of the Access Approvals request. This is a helpful field when requesting support from Google.
  *   `scope` (*type:* `String.t`, *default:* `nil`) - Scope of access, also known as a resource. This is further narrowed down by the product field.
  *   `tickets` (*type:* `list(GoogleApi.AlertCenter.V1beta1.Model.SupportTicket.t)`, *default:* `nil`) - Support tickets related to this Access Approvals request. Populated if there is an associated case number.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :justificationReason => list(String.t()) | nil,
          :officeLocation => String.t() | nil,
          :products => list(String.t()) | nil,
          :requestId => String.t() | nil,
          :scope => String.t() | nil,
          :tickets => list(GoogleApi.AlertCenter.V1beta1.Model.SupportTicket.t()) | nil
        }

  field(:justificationReason, type: :list)
  field(:officeLocation)
  field(:products, type: :list)
  field(:requestId)
  field(:scope)
  field(:tickets, as: GoogleApi.AlertCenter.V1beta1.Model.SupportTicket, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.AlertCenter.V1beta1.Model.AccessApproval do
  def decode(value, options) do
    GoogleApi.AlertCenter.V1beta1.Model.AccessApproval.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AlertCenter.V1beta1.Model.AccessApproval do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
